package com.fanxuankai.boot.canal.client.autoconfigure;

import com.fanxuankai.boot.canal.client.RocketMqEntryConsumer;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;

/**
 * @author fanxuankai
 */
@ConditionalOnClass({RocketMQTemplate.class})
@ConditionalOnMissingClass({"com.fanxuankai.boot.mqbroker.producer.EventPublisher"})
@ConditionalOnProperty(name = CanalClientProperties.ENABLED, matchIfMissing = true)
public class CanalClientRocketMqAutoConfiguration {
    @Bean
    public RocketMqEntryConsumer rocketMqEntryConsumer() {
        return new RocketMqEntryConsumer();
    }
}
